//
//  FolderViewController.h
//  iGSS
//
//  Copyright 2010 Electronic Business Systems Ltd.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

#import <UIKit/UIKit.h>

@class GSSObject;
@class GSSQuery;

@interface FolderViewController : UITableViewController <UISearchDisplayDelegate, UIActionSheetDelegate> {
    GSSObject *object;
    GSSQuery *query;
    
    NSArray *children;
    NSDateFormatter *dateFormatter;
    
    BOOL loading;
    
    BOOL showsAddButton;
    BOOL showsDeleted;
    
    UILabel *footerTopLabel;
    UILabel *footerBottomLabel;
    
    UIToolbar *toolbar;
    UILabel *toolbarLabel;
    UIActivityIndicatorView *activityIndicator;
}

@property (nonatomic, retain) GSSQuery *query;

@property (nonatomic, retain) NSArray *children;
@property (nonatomic, readonly) NSDateFormatter *dateFormatter;

@property (nonatomic, assign, getter=isLoading) BOOL loading;

@property (nonatomic, assign) BOOL showsAddButton;
@property (nonatomic, assign) BOOL showsDeleted;

@property (nonatomic, retain) IBOutlet UILabel *footerTopLabel;
@property (nonatomic, retain) IBOutlet UILabel *footerBottomLabel;

@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;
@property (nonatomic, retain) IBOutlet UILabel *toolbarLabel;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *activityIndicator;

- (id)initWithGSSObject:(GSSObject *)anObject;

- (void)authenticate;
- (void)reloadData;
- (void)reloadToolbar;
- (void)startActivity;
- (void)stopActivity;

- (IBAction)refreshPressed;
- (IBAction)homePressed;
- (IBAction)addPressed;

@end
